<template>
	<view>
		<view class="card-view" v-if="entity">
			<view class="row-between cell-view">
				<view class="row-div vertical-view">供应商信息</view>
			</view>
			<view class="row-between cell-view">
				<view class="left-text">供应商：</view>
				<view class="right-text">{{entity.vendorName || '暂无'}}</view>
			</view>
			<view class="row-between cell-view">
				<view class="left-text">供货价：</view>
				<view class="right-text">{{entity.supplyPrice ? '￥' + entity.supplyPrice : '暂无'}}</view>
			</view>
			<view class="row-between cell-view">
				<view class="left-text">保证金：</view>
				<view class="right-text">{{entity.securityDeposit ? '￥' + entity.securityDeposit : '暂无'}}</view>
			</view>
			<view class="column-div cell-view">
				<view class="left-text" style="width: 100%;margin-bottom: 43upx;">供货合同：</view>
				<!-- <view>暂无数据</view> -->
				<mp-html :content="entity.supplyContract">{{entity.supplyContract ? '' : '暂无'}}</mp-html>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				goodsCd: null,
				entity: null
			}
		},
		onLoad(options) {
			this.goodsCd = options.goodsCd;
			this.getRequest();
		},
		methods: {
			imgtap (e) {
				let imgList = this.$refs['MpHtml'].imgList
				console.log("imgtap", e, imgList)
			},
			getRequest () {
				this.$api.showLoading()
				return this.$api.globalUtil.requestAjax({
					url: '/GoodsApi/priceSetup',
					method: 'POST',
					data: {
						goodsCd: this.goodsCd
					},
					success: (res) => {
						if (!res.data.success) return this.$api.msg(res.data.msg || '获取失败');
						this.entity = res.data.response;
					},
					complate: () => this.$api.hideLoading()
				});
			}
		}
	}
</script>

<style scoped lang="scss">
	.card-view{
		width: 100%;
		background: #FFFFFF;
		border-radius: 16upx;
		margin: 30upx 0;
		.cell-view{
			width: 100%;
			padding: 38upx 30upx;
			border-bottom: 1px solid #EEEEEE;
			font-size: 26upx;
			font-family: PingFang SC;
			font-weight: 500;
			position: relative;
			&:last-child{
				border-bottom: none;
			}
			.vertical-view{
				font-size: 32upx;
				font-weight: bold;
				color: #333333;
				&::before{
					content: " ";
					position: absolute;
					left: 0;
					width: 4upx;
					height: 30upx;
					background: #FE5E49;
					border-radius: 2upx;
				}
			}
			.left-text{
				color: #999999;
			}
			.right-text{
				color: #333333;
			}
			
		}
	}
</style>
